home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / mpmod160.zip / SOURCE.ZIP / SOURCE.DOC < prev    next >
Text File  |  1994-01-01  |  10KB  |  206 lines

  1.  
  2. This document  describes implementation by MpModem  of special compression,
  3. large blocks and fast modes.
  4.  
  5. The  compression  mode  is  an  adaptation  of  Richard B. Johnson's Jmodem
  6. compression which is both fast and  small. The overhead placed on Zmodem is
  7. minimal but people may experience slower than optimum speeds on rather slow
  8. machines. The  compression method bears NO  resemblance to Chuck Forsberg's
  9. "RLE" type compression  which is copyright to that  person. See MPMODEM.DOC
  10. for full details of how you can include this source in your code for free.
  11.  
  12.  
  13. The large block mode allows you to transfer files with large blocks of data
  14. than the  normal maximum of 1024  bytes. This could in  some cases speed up
  15. the transfer of files. The benefits are small but may be worthwhile in your
  16. application. This  is copyright, but is  able to be used  in your programs.
  17. See MPMODEM.DOC for full details of how you can include this source in your
  18. code for free.
  19.  
  20.  
  21. The fast mode is an adaptation of Personalized Computer Programming Company
  22. "PC²"  with  one  significant  difference.  PC²'s  implementation  utilises
  23. variable  length headers  which are  purportedly the  copyright material of
  24. Chuck Forsberg. Given this, I have adapted this process to not use variable
  25. length headers.  See MPMODEM.DOC for  full details of  how you can  include
  26. this source in your code for free.
  27.  
  28.  
  29. There  are various  files included  in this  archive. All  these files  are
  30. designed only to show programmers the way to change their implementation of
  31. Zmodem to use the above enhancements.
  32.  
  33.  
  34. The files are:
  35.  
  36.    Z-RX.C      -  Contains  all the  receive specific  routines required by
  37.                   Zmodem.  Only  the  routines   applicable  to  the  above
  38.                   modifications are contained.
  39.  
  40.    Z-TX.C      -  Contains  all  the  send  specific  routines  required by
  41.                   Zmodem.  Only  the  routines   applicable  to  the  above
  42.                   modifications are contained.
  43.  
  44.    Z-GEN.C     -  Contains  all  of  the  miscellaneous  routines  used  by
  45.                   Zmodem.   Only   routines   applicable   to   the   above
  46.                   modifications are contained.
  47.  
  48.    Z-GEN.H     -  Contains Zmodem defines and  masks used to determine such
  49.                   things  as whether  the remote  can send/receive  in fast
  50.                   and/or compressed mode and so on.
  51.  
  52.    COMPRESS.C  -  Contains the compression and decompression routines.
  53.  
  54.    COMPRESS.H  -  Header  file  for  inclusion  in  Z-RX.C  and  Z-TX.C (if
  55.                   required).
  56.  
  57. Rather than explain all the nuts and bolts of the two methods, I will leave
  58. that to the code. I will explain the main variables though:
  59.  
  60.   Variable
  61.     Name          Description
  62.   ------------------------------------------------------------------------
  63.    RxType
  64.                   Current type of transmission being received. These values
  65.                   are established when the  receiver receives a header. The
  66.                   possible  values are:
  67.                      0  -  Binary (with  CRC-16) and Hex headers.
  68.                      1  -  Binary (with  CRC-32).
  69.                      2  -  Not used (next release).
  70.                      3  -  Binary compressed (with CRC-32).
  71.                      4  -  Binary compressed (with CRC-16).
  72.  
  73.    TxType         Current type of transmission being sent. These values are
  74.                   established by what you  want (compression, FAST etc) and
  75.                   what the  receiver says it  wants. It is  reinstated from
  76.                   TxMaster when  you send a binary  header. This allows the
  77.                   binary transmission to be sent  in the mode negotiated at
  78.                   startup.
  79.  
  80.    TxMaster       This is the transfer type master flag which is negotiated
  81.                   at  startup  with  the  receiver.  This  value is used to
  82.                   reinstate the transfer type after  it has changed (when a
  83.                   hex header  has been sent). Possible  values are the same
  84.                   as RxType. (see above)
  85.  
  86.    TryComp        This is a flag which is set depending on the command line
  87.                   options.  In MpModem's  case, it  is set  when MpModem is
  88.                   invoked with "-c".
  89.  
  90.    TryFast        This is a flag which is set depending on the command line
  91.                   options.  In MpModem's  case, it  is set  when MpModem is
  92.                   invoked with "-f".
  93.  
  94.    TryBig         This is a flag which is set depending on the command line
  95.                   options.  In MpModem's  case, it  is set  when MpModem is
  96.                   invoked with the "-l" switch.
  97.  
  98.    WantComp       In send mode:
  99.                      Receiver  has said  it  wants  to try  compression. If
  100.                      "TryComp" is also true, then  the sender will send off
  101.                      a header  telling the receiver  that it also  wants to
  102.                      try  compression. In  this case,  compression has been
  103.                      negotiated  successfully  and  will  take  place  when
  104.                      needed.
  105.  
  106.                   In receive mode:
  107.                      If "TryComp"  has been set by  the command line switch
  108.                      of "-c"  then the receiver will  check the packet sent
  109.                      by  the  sender.  If  it  contains  a directive to use
  110.                      compression,  then  the  receiver  will  set this flag
  111.                      enabling compression.
  112.  
  113.                      Note: The  "WantComp" flag is  not really needed  once
  114.                      the compression has  been negotiated successfully. The
  115.                      way  the receiver  knows if  the sender  is sending  a
  116.                      compressed packet  is by the frame  end (eg ZCRCG_C as
  117.                      against ZCRCG).
  118.  
  119.    WantFast       In send mode:
  120.                      Receiver has sent  a header. If in that  header is the
  121.                      command  to try  a Fast  transmission then  the sender
  122.                      sets "WantFast"  to 1. If the  flag "TryFast" has been
  123.                      set,  then the  sender will  send off  confirmation of
  124.                      wanting a fast transmission.
  125.  
  126.                   In receive mode:
  127.                      Not required or used in receive mode.
  128.  
  129.    WantBig        In send mode:
  130.                      Receiver has  signalled its intention  to try to  send
  131.                      large  blocks. Once  set  to  TRUE, and  providing the
  132.                      sender wants to also send  big blocks, the sender will
  133.                      send off confirmation that we want a transmission made
  134.                      up of big blocks.
  135.  
  136.                   In receive mode:
  137.                      This is used by MpModem to regulate repositions. I use
  138.                      this flag when a reposition is received to IMMEDIATELY
  139.                      cut the block  size down - the bigger  block size is a
  140.                      real killer when  you have to go back  and resend part
  141.                      of the file.
  142.  
  143.    UsingBig       In send mode:
  144.                      Not used as yet.
  145.  
  146.                   In receive mode:
  147.                      Not used as yet.
  148.  
  149.    UsingFast      In send mode:
  150.                      This  flag is  set to   1 (true)  if the  command line
  151.                      switch  "TryFast"  is  set  to  1  (see above) and the
  152.                      "WantFast" switch  is also set to  1 (see above). Once
  153.                      set to 1, "UsingFast" will make the SendByte() routine
  154.                      in the  Z-TX.C file ONLY escape  ZDLE bytes. All other
  155.                      bytes will go through without any special encoding.
  156.  
  157.                   In receive mode:
  158.                      Set  to   1  (true)  if   the  sender  wants   a  fast
  159.                      transmission. This  flag is then  used in the  routine
  160.                      which gets the bytes to  bypass some of the checks for
  161.                      encoded bytes. See Z-GEN.C routine GetZDLE().
  162.  
  163.                   Log